#include "FKLocalObjectManager.h"
#include <QVariant>

#include "../FKTools/FKLogger.h"

//#include "FKEvent.h"
//#include "FKClient.h"

FKLocalObjectManager::FKLocalObjectManager():FKAbstractObjectManager(){
    FK_CBEGIN
    FK_CEND
}

FKLocalObjectManager::~FKLocalObjectManager(){
    FK_DBEGIN
    FK_DEND
}

void FKLocalObjectManager::returnMessage(qint32 clientID, QString text){
    showMessage(text+QString(". Owner: ")+QString::number(clientID));
}

//void FKLocalObjectManager::clientRequested(QString clientName, QString password){
//    getClient(clientName,password,0);
//}

//void FKLocalObjectManager::getClient(QString clientName, QString password){
//    getClient(clientName,password,0);
//}

void FKLocalObjectManager::getClient(QString clientName, QString password, FKClientManager* s){
    Q_UNUSED(s)
    QString error(checkClient(clientName,password));
    if(error==QString()){
        setLocalClient(catchClient(clientName,password));
//        emit clientSetted(getLocalClient());
    }else{
        showMessage(error);
    }
}
